﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using ArriendoVehiculo.LogicaNegocio;

namespace ArriendoVehiculo.Presentacion
{
    /// <summary>
    /// Lógica de interacción para fconsultaAuto.xaml
    /// </summary>
    public partial class fconsultaAuto : Window
    {
        public fconsultaAuto()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Vehiculo vehi = new Vehiculo();
            var v=vehi.recivirVehiculo(txt_marca.Text, txt_modelo.Text, txt_color.Text);
            if (v != null)
            {
                txt_cantidad.Text = "" + v.Cantidad;
                txt_nropuertas.Text = v.Nro_puertas + "";
                txt_codigo.Text = v.Id_vehiculos + "";
            }
            else
            {

                MessageBox.Show("El vehiculo no existe", "Mensaje", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
            if (Vehiculo.recivirArriendoCliente(txt_marca.Text, txt_modelo.Text, txt_color.Text) == "")
            {
                txt_arrendatarios.Text = "No existen arrendatarios";
            }
            else
            {
                txt_arrendatarios.Text = Vehiculo.recivirArriendoCliente(txt_marca.Text, txt_modelo.Text, txt_color.Text);
            }
          
        }
    }
}
